package com.portal.web.action.system.role;

import com.portal.model.ResultMessage;
import com.portal.web.action.BaseAction;

/**
 * 设置角色权限信息
 * 
 * @author liu.qiao
 * 
 */
public class setRolePower extends BaseAction {
	private static final long serialVersionUID = 1L;
	private ResultMessage result = new ResultMessage("0", "");
	private String menuCodes;
	private String funCodes;
	private String roleCode;

	public String execute() throws Exception {
		try {
			this.getServiceContainer().getRoleService().setRolePower(roleCode,
					menuCodes, funCodes);
		} catch (Exception e) {
			e.printStackTrace();
			setResult(new ResultMessage("100", "角色权限设置失败！"));
			return ERROR;
		}
		setResult(new ResultMessage("0", "角色权限设置成功！"));
		return SUCCESS;
	}

	public String getMenuCodes() {
		return menuCodes;
	}

	public void setMenuCodes(String menuCodes) {
		this.menuCodes = menuCodes;
	}

	public String getFunCodes() {
		return funCodes;
	}

	public void setFunCodes(String funCodes) {
		this.funCodes = funCodes;
	}

	public String getRoleCode() {
		return roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}

	public ResultMessage getResult() {
		return result;
	}

	public void setResult(ResultMessage result) {
		this.result = result;
	}

}
